Imports System
Imports System.Web.Caching
Imports System.Reflection

Namespace ModuleMasters.DNN.Modules.NCAAPoolBracket

    Public MustInherit Class DataProvider

#Region "Shared/Static Methods"
        ' singleton reference to the instantiated object 
        Private Shared objProvider As DataProvider = Nothing

        ' constructor
        Shared Sub New()
            CreateProvider()
        End Sub

        ' dynamically create provider
        Private Shared Sub CreateProvider()
            objProvider = CType(Framework.Reflection.CreateObject("data", "ModuleMasters.DNN.Modules.NCAAPoolBracket", "ModuleMasters.DNN.Modules.NCAAPoolBracket"), DataProvider)
        End Sub

        ' return the provider
        Public Shared Shadows Function Instance() As DataProvider
            Return objProvider
        End Function
#End Region

#Region "Abstract Methods"

        Public MustOverride Function GetUserPicks(ByVal ModuleId As Integer, ByVal UserId As Integer) As IDataReader
        Public MustOverride Function GetResults(ByVal ModuleId As Integer) As IDataReader
        Public MustOverride Sub InsertUserPrediction(ByVal PortalId As Integer, ByVal ModuleId As Integer, ByVal UserId As Integer, ByVal GameId As String, ByVal TeamName As String, ByVal GameScore As Integer, ByVal TeamAScore As Integer, ByVal TeamBScore As Integer)
        Public MustOverride Sub InsertResults(ByVal PortalId As Integer, ByVal ModuleId As Integer, ByVal GameId As String, ByVal TeamName As String, ByVal GameScore As Integer, ByVal TeamAScore As Integer, ByVal TeamBScore As Integer)
        Public MustOverride Sub DeleteUserPrediction(ByVal ModuleId As Integer, ByVal UserId As Integer)
        Public MustOverride Function GetRoundPoints(ByVal PortalId As Integer, ByVal ModuleId As Integer) As IDataReader
        Public MustOverride Sub DeleteRoundPoints(ByVal PortalId As Integer, ByVal ModuleId As Integer)
        Public MustOverride Sub InsertRoundPoints(ByVal PortalId As Integer, ByVal ModuleId As Integer, ByVal RoundId As Integer, ByVal RoundPoints As Integer, ByVal RoundGames As Integer)
        Public MustOverride Sub ClearResults(ByVal PortalId As Integer, ByVal ModuleId As Integer)

#End Region

    End Class

End Namespace
